
<link href="css/templates.css" type="text/css" rel="stylesheet">
<script>
function mo_form_sua(ms_linh_vuc){
	document.frmDLsua.ms_linh_vuc.value=ms_linh_vuc;
	document.frmDLsua.submit();
	}

function thuchienxoa(){
	var f = document.frmdslvtd;
	var dslvtd = "";
	if(f.chkxoa.length != undefined){  //trong tinh trang co 2 cai de xoa
		var len = f.chkxoa.length;
		for( var i = 0; i < len; i++){
			if( f.chkxoa[i].checked){
				if( dslvtd == ""){
					dslvtd = f.chkxoa[i].value;
				}else dslvtd = dslvtd+","+f.chkxoa[i].value;
			}
		}
	}else 
	if(f.chkxoa.checked){
				dslvtd = f.chkxoa.value;
			}
	if(dslvtd == ""){
		alert('Vui lòng chọn lĩnh vực tuyển dụng cần xóa...');
		
		return false;
	}
	if(confirm('Bạn chắc muốn xóa lĩnh vực này không?')){
		document.frmDLxoa.ms_linh_vuc.value=dslvtd;
		
		document.frmDLxoa.submit();
	}
}
</script>
<?php
	include ("connect.php"); 
	$sql="SELECT * FROM linh_vuc_td ORDER BY MS_LINH_VUC";
	$rs=mysql_query($sql);
?>
<div class="content">
    <div class="content_bg">
	 <div class="mainbar">
	 <div class="article">
<form name="frmdslvtd">
<table width="643px" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td colspan="5" style="text-align:center" class="title_ds"><h2><b>Danh sách lĩnh vực tuyển dụng</b></h2></td>
  </tr>
  <tr>
    <td align="center" class="title_ds">STT</td>
    <td align="center" class="title_ds">Mã số lĩnh vực</td>
    <td align="center" class="title_ds">Tên lĩnh vực</td>
    <td align="center" class="title_ds">Sửa</td>
    <td align="center" class="title_ds">Xóa</td>
  </tr>
<?php
	$i=0;
	while($rw=mysql_fetch_array($rs)){
		$i++;						
?>
  <tr>
    <td class="css_stt"><?php  echo $i; ?></td>
    <td class="grid"><?php echo $rw['MS_LINH_VUC'] ?>&nbsp;</td>
    <td class="grid"><?php echo $rw['TEN_LINH_VUC'] ?>&nbsp;</td>
    <td align="center" class="grid"><img src="images/edit.gif" border="0" onClick="mo_form_sua('<?php echo $rw['MS_LINH_VUC'];?>')"/></td>
    <td align="center"><span class="grid"><input type="checkbox" name="chkxoa" value="<?php echo $rw['MS_LINH_VUC']; ?>  " /></span></td>
  </tr>
<?php
	} 
?>

</table>
</form>
<div align="center"><input type="button" name="them" id="them" value="Thêm lĩnh vực" onclick="location.href='index.php?noidung=tlvtd'"/>&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" name="xoa" id="xoa" value="Xóa" onClick="thuchienxoa()"/></div>
</div>
  </div>
  </div>
  </div>
<form name="frmDLxoa" action="linh_vuc_td/xoa_lvtd.php" method="post">
<input type="hidden" name="ms_linh_vuc" value=""/>
</form>

<form name="frmDLsua" method="post" action="index.php?noidung=slvtd">
<input type="hidden" name="ms_linh_vuc" value="">
</form>
